HAL SRAM types migration

This section provides information about the HAL SRAM types migration.

HAL SRAM callback ID type definition

HAL1

HAL2

typedef enum {
  HAL_SRAM_DMA_XFER_CPLT_CB_ID,
  HAL_SRAM_DMA_XFER_ERR_CB_ID,
  HAL_SRAM_MSP_DEINIT_CB_ID,
  HAL_SRAM_MSP_INIT_CB_ID,
} HAL_SRAM_CallbackIDTypeDef;
  • Removed from HAL2 : the callback registration is managed by dedicated functions for each SRAM event. For more details, see : Reads, write and callback functions.

  • HAL_SRAM_MSP_INIT_CB_ID and HAL_SRAM_MSP_DEINIT_CB_ID are removed because the functions HAL_SRAM_MspInit() and HAL_SRAM_MspDeInit() are removed.

Note

The user is responsible for the process and callback, while the SRAM driver handles only initialization and configuration.

Related concept: Other HAL SRAM changes Related use case: Use case: Read and write DMA operations


HAL SRAM state type definition

HAL1

HAL2

typedef enum {
  HAL_SRAM_STATE_RESET,
  HAL_SRAM_STATE_READY,
  HAL_SRAM_STATE_BUSY,
  HAL_SRAM_STATE_ERROR,
  HAL_SRAM_STATE_PROTECTED,
} HAL_SRAM_StateTypeDef;
typedef enum {
  HAL_SRAM_STATE_RESET,
  HAL_SRAM_STATE_IDLE,
  HAL_SRAM_STATE_INIT,
  HAL_SRAM_STATE_CONFIGURED,
  HAL_SRAM_STATE_MEMORY_CONFIGURED,
} hal_sram_state_t;

Note

  • HAL_SRAM_STATE_BUSY is not needed (No more process APIs).

  • HAL_SRAM_STATE_ERROR is not needed (No more process APIs).

  • HAL_SRAM_STATE_PROTECTED is removed, no more state to reflect the SRAM write protection instead use the function HAL_SRAM_IsEnabledWriteProtection to know if the sram is write protected.

  • HAL_SRAM_STATE_READY is replaced with HAL_SRAM_STATE_IDLE.

Related concept: Revised and optimized HAL state machine


HAL SRAM handle type definition

HAL1

HAL2

SRAM_HandleTypeDef
hal_sram_handle_t

Related concept: Renaming of the handle structure


HAL SRAM callback type definition

HAL1

HAL2

pSRAM_CallbackTypeDef
Removed: No more need for callback (no more process).

Related concept: Renaming of the handle structure


HAL SRAM DMA callback type definition

HAL1

HAL2

pSRAM_DmaCallbackTypeDef
Removed: No more need for callback (no more process).

Related concept: Renaming of the handle structure